//
//  NEDApp.m
//  000
//
//  Created by 林宁宁 on 2019/9/18.
//  Copyright © 2019 000. All rights reserved.
//

#import "NEDApp.h"

@implementation NEDApp


+(instancetype)shareManager{
    static NEDApp * ss = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        
        ss = [[NEDApp alloc] init];
        
        [ss ned_originSetting];
        
    });
    return ss;
}

#pragma mark - NEDAppMethodExtendProtocol

- (void)ned_originSetting{}

#pragma mark - 

-(id<UIApplicationDelegate>)appDelegte{
    return [UIApplication sharedApplication].delegate;
}

-(UIWindow *)window{
    return [[[UIApplication sharedApplication] delegate] window];
}

-(NEDDBSetting *)setting{
    if(!_setting){
        _setting = [NEDDBSetting sharedInstance];
        
        if(!_setting.firstOpenTimeTemp){
            _setting.firstOpenTimeTemp = [[NSDate date] timeIntervalSince1970];
        }
    }
    return _setting;
}

-(NEDDBUserInfo *)uinfo{
    if(!_uinfo){
        _uinfo = [NEDDBUserInfo sharedInstance];
    }
    return _uinfo;
}

-(NEDAppInfo *)info{
    if(!_info){
        _info = [[NEDAppInfo alloc] init];
    }
    return _info;
}
-(NEDAppStatus *)status{
    if(!_status){
        _status = [NEDAppStatus new];
    }
    return _status;
}

#pragma mark - 

@end
